import axios from "axios"

// export function getTest(data){
//   return axios.get(`http://pjskpq.natappfree.cc/test`,data)
// }
const back_api_dom = "4t8nf7";
// http://4t8nf7.natappfree.cc
const screen_api_dom = ""

// const n = 1

export function getLiuLiang(data, _page = 1) {
  return axios.request({
    url: `http://${back_api_dom}.natappfree.cc/%2Fliuliang/Liuliang/`,
    data: data,
    params: {page: _page}
  });
  // http://iq2tyf.natappfree.cc/%2Fliuliang/Liuliang/?page=1
}

export function getLiuLiang2(id = 1, data) {
  return axios.get(`http://${back_api_dom}.natappfree.cc/%2Fliuliang/Liuliang/tt/${id}/`, data);
  // http://iq2tyf.natappfree.cc/%2Fliuliang/tt/1/
}

// 后台数据 getAttackType也用于大屏
export function getAttackType(data) {
  return axios.get(`http://${back_api_dom}.natappfree.cc/%2Fhome_page/Attack_type/`, data)
  // http://iq2tyf.natappfree.cc/%2Fhome_page/Attack_type/
}

export function getWeekData(data) {
  return axios.get(`http://${back_api_dom}.natappfree.cc/%2Fhome_page/Real_time_traffic_week/`, data)
}

export function getMonthData(data) {
  return axios.get(`http://${back_api_dom}.natappfree.cc/%2Fhome_page/Real_time_traffic_month/`, {
    params:data
  })
}

export function getHourData(data) {
  return axios.get(`http://${back_api_dom}.natappfree.cc/%2Fhome_page/Real_time_traffic_24hour/`, data)
}

export function getIPTopData(data) {
  return axios.get(`http://${back_api_dom}.natappfree.cc/%2Fhome_page/top_ip/`, data)
}

export function getPortPieData(data) {
  return axios.get(`http://${back_api_dom}.natappfree.cc/%2Fliuliang/simple/`, data)
}

// 大屏数据
// 流量排行榜
export function getBugTopData(data) {
  return axios.get(`http://${screen_api_dom}.natappfree.cc/screen/showBugTop`, data)
}

// 攻击数量
export function getAttackCountData(data) {
  return axios.get(`http://${screen_api_dom}.natappfree.cc/screen/attack`, data)
}

// 安全威胁等级
export function getSecurityData(data) {
  return axios.get(`http://${screen_api_dom}.natappfree.cc/screen/security`, data)
}

// 威胁信息日志
export function getThreatData(data) {
  return axios.get(`http://${screen_api_dom}.natappfree.cc/screen/threatLog`, data)
}

// 实时流量
export function getRealTimeData(data) {
  return axios.get(`http://${screen_api_dom}.natappfree.cc/screen/realTime`, data)
}

// 近期每日流量
export function getFlowData(data) {
  return axios.get(`http://${screen_api_dom}.natappfree.cc/screen/flow/7`, data)
}